package com.wxb.cardmis.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * All rights Reserved, Designed By www.super-master.cn
 *
 * @ProjectName: cardmis
 * @Package: com.wxb.cardmis.utils
 * @ClassName: MyUtil
 * <p> </p>
 * @Author: [Wei Xiao]
 * @Date: 2022/2/21 18:18
 * @Version: V1.0
 * @Copyright: 2022  com.wei All rights reserved.
 * TODO: 注意,本文件Wei Xiao所作,如果转载或使用请标明具体出处!
 * @Date: 2022年02月21日 18:18
 * @Description: []
 **/
public class MyUtil {

    public static String getNewFileName(String oldFileName){
        int lastIndex = oldFileName.lastIndexOf(".");
        String fileType = oldFileName.substring(lastIndex);
        Date now = new Date();

        SimpleDateFormat sdf = new SimpleDateFormat("YYYYMMDDHHmmssSSS");
        String time = sdf.format(now);
        String newFileName = time+fileType;
        return newFileName;
    }
}
